<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<TITLE>
ListBox (Google Web Toolkit Javadoc)
</TITLE>

<META NAME="keywords" CONTENT="com.google.gwt.user.client.ui.ListBox class">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../stylesheet.css" TITLE="Style">

<SCRIPT type="text/javascript">
function windowTitle()
{
    parent.document.title="ListBox (Google Web Toolkit Javadoc)";
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>

</HEAD>

<BODY BGCOLOR="white" onload="windowTitle();">


<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../../../../com/google/gwt/user/client/ui/Label.html" title="class in com.google.gwt.user.client.ui"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../../../../com/google/gwt/user/client/ui/LoadListener.html" title="interface in com.google.gwt.user.client.ui"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../../../../../index.html?com/google/gwt/user/client/ui/ListBox.html" target="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="ListBox.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
&nbsp;<SCRIPT type="text/javascript">
  <!--
  if(window==top) {
    document.writeln('<A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
  }
  //-->
</SCRIPT>
<NOSCRIPT>
  <A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>


</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  SUMMARY:&nbsp;<A HREF="#nested_classes_inherited_from_class_com.google.gwt.user.client.ui.UIObject">NESTED</A>&nbsp;|&nbsp;<A HREF="#fields_inherited_from_class_com.google.gwt.user.client.ui.UIObject">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->

<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
com.google.gwt.user.client.ui</FONT>
<BR>
Class ListBox</H2>
<PRE>
java.lang.Object
  <IMG SRC="../../../../../../resources/inherit.gif" ALT="extended by "><A HREF="../../../../../../com/google/gwt/user/client/ui/UIObject.html" title="class in com.google.gwt.user.client.ui">com.google.gwt.user.client.ui.UIObject</A>
      <IMG SRC="../../../../../../resources/inherit.gif" ALT="extended by "><A HREF="../../../../../../com/google/gwt/user/client/ui/Widget.html" title="class in com.google.gwt.user.client.ui">com.google.gwt.user.client.ui.Widget</A>
          <IMG SRC="../../../../../../resources/inherit.gif" ALT="extended by "><A HREF="../../../../../../com/google/gwt/user/client/ui/FocusWidget.html" title="class in com.google.gwt.user.client.ui">com.google.gwt.user.client.ui.FocusWidget</A>
              <IMG SRC="../../../../../../resources/inherit.gif" ALT="extended by "><B>com.google.gwt.user.client.ui.ListBox</B>
</PRE>
<DL>
<DT><B>All Implemented Interfaces:</B> <DD><A HREF="../../../../../../com/google/gwt/user/client/EventListener.html" title="interface in com.google.gwt.user.client">EventListener</A>, <A HREF="../../../../../../com/google/gwt/user/client/ui/HasFocus.html" title="interface in com.google.gwt.user.client.ui">HasFocus</A>, <A HREF="../../../../../../com/google/gwt/user/client/ui/HasName.html" title="interface in com.google.gwt.user.client.ui">HasName</A>, <A HREF="../../../../../../com/google/gwt/user/client/ui/SourcesChangeEvents.html" title="interface in com.google.gwt.user.client.ui">SourcesChangeEvents</A>, <A HREF="../../../../../../com/google/gwt/user/client/ui/SourcesClickEvents.html" title="interface in com.google.gwt.user.client.ui">SourcesClickEvents</A>, <A HREF="../../../../../../com/google/gwt/user/client/ui/SourcesFocusEvents.html" title="interface in com.google.gwt.user.client.ui">SourcesFocusEvents</A>, <A HREF="../../../../../../com/google/gwt/user/client/ui/SourcesKeyboardEvents.html" title="interface in com.google.gwt.user.client.ui">SourcesKeyboardEvents</A></DD>
</DL>
<HR>
<DL>
<DT><PRE>public class <B>ListBox</B><DT>extends <A HREF="../../../../../../com/google/gwt/user/client/ui/FocusWidget.html" title="class in com.google.gwt.user.client.ui">FocusWidget</A><DT>implements <A HREF="../../../../../../com/google/gwt/user/client/ui/SourcesChangeEvents.html" title="interface in com.google.gwt.user.client.ui">SourcesChangeEvents</A>, <A HREF="../../../../../../com/google/gwt/user/client/ui/HasName.html" title="interface in com.google.gwt.user.client.ui">HasName</A></DL>
</PRE>

<P>
A widget that presents a list of choices to the user, either as a list box or
 as a drop-down list.
 
 <p>
 <img class='gallery' src='ListBox.png'/>
 </p>
 
 <h3>CSS Style Rules</h3>
 <ul class='css'>
 <li>.gwt-ListBox { }</li>
 </ul>
 
 <p>
 <h3>Example</h3>
 <blockquote><pre>public class ListBoxExample implements EntryPoint {

  public void onModuleLoad() {
    // Make a new list box, adding a few items to it.
    ListBox lb = new ListBox();
    lb.addItem("foo");
    lb.addItem("bar");
    lb.addItem("baz");
    lb.addItem("toto");
    lb.addItem("tintin");

    // Make enough room for all five items (setting this value to 1 turns it
    // into a drop-down list).
    lb.setVisibleItemCount(5);

    // Add it to the root panel.
    RootPanel.get().add(lb);
  }
}
</pre></blockquote>
 </p>
<P>

<P>
<HR>

<P>
<!-- ======== NESTED CLASS SUMMARY ======== -->

<A NAME="nested_class_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Nested Class Summary</B></FONT></TH>
</TR>
</TABLE>
&nbsp;<A NAME="nested_classes_inherited_from_class_com.google.gwt.user.client.ui.UIObject"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.<A HREF="../../../../../../com/google/gwt/user/client/ui/UIObject.html" title="class in com.google.gwt.user.client.ui">UIObject</A></B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="../../../../../../com/google/gwt/user/client/ui/UIObject.DebugIdImpl.html" title="class in com.google.gwt.user.client.ui">UIObject.DebugIdImpl</A>, <A HREF="../../../../../../com/google/gwt/user/client/ui/UIObject.DebugIdImplEnabled.html" title="class in com.google.gwt.user.client.ui">UIObject.DebugIdImplEnabled</A></CODE></TD>
</TR>
</TABLE>
&nbsp;
<!-- =========== FIELD SUMMARY =========== -->

<A NAME="field_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Field Summary</B></FONT></TH>
</TR>
</TABLE>
&nbsp;<A NAME="fields_inherited_from_class_com.google.gwt.user.client.ui.UIObject"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Fields inherited from class com.google.gwt.user.client.ui.<A HREF="../../../../../../com/google/gwt/user/client/ui/UIObject.html" title="class in com.google.gwt.user.client.ui">UIObject</A></B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="../../../../../../com/google/gwt/user/client/ui/UIObject.html#DEBUG_ID_PREFIX">DEBUG_ID_PREFIX</A></CODE></TD>
</TR>
</TABLE>
&nbsp;
<!-- ======== CONSTRUCTOR SUMMARY ======== -->

<A NAME="constructor_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Constructor Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../com/google/gwt/user/client/ui/ListBox.html#ListBox()">ListBox</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Creates an empty list box in single selection mode.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../com/google/gwt/user/client/ui/ListBox.html#ListBox(boolean)">ListBox</A></B>(boolean&nbsp;isMultipleSelect)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Creates an empty list box.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected </CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../com/google/gwt/user/client/ui/ListBox.html#ListBox(com.google.gwt.dom.client.Element)">ListBox</A></B>(<A HREF="../../../../../../com/google/gwt/dom/client/Element.html" title="class in com.google.gwt.dom.client">Element</A>&nbsp;element)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This constructor may be used by subclasses to explicitly use an existing
 element.</TD>
</TR>
</TABLE>
&nbsp;
<!-- ========== METHOD SUMMARY =========== -->

<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Method Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../com/google/gwt/user/client/ui/ListBox.html#addChangeListener(com.google.gwt.user.client.ui.ChangeListener)">addChangeListener</A></B>(<A HREF="../../../../../../com/google/gwt/user/client/ui/ChangeListener.html" title="interface in com.google.gwt.user.client.ui">ChangeListener</A>&nbsp;listener)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Adds a listener interface to receive change events.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../com/google/gwt/user/client/ui/ListBox.html#addItem(java.lang.String)">addItem</A></B>(java.lang.String&nbsp;item)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Adds an item to the list box.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../com/google/gwt/user/client/ui/ListBox.html#addItem(java.lang.String, java.lang.String)">addItem</A></B>(java.lang.String&nbsp;item,
        java.lang.String&nbsp;value)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Adds an item to the list box, specifying an initial value for the item.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../com/google/gwt/user/client/ui/ListBox.html#clear()">clear</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Removes all items from the list box.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../com/google/gwt/user/client/ui/ListBox.html#getItemCount()">getItemCount</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Gets the number of items present in the list box.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../com/google/gwt/user/client/ui/ListBox.html#getItemText(int)">getItemText</A></B>(int&nbsp;index)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Gets the text associated with the item at the specified index.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../com/google/gwt/user/client/ui/ListBox.html#getName()">getName</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Gets the widget's name.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../com/google/gwt/user/client/ui/ListBox.html#getSelectedIndex()">getSelectedIndex</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Gets the currently-selected item.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../com/google/gwt/user/client/ui/ListBox.html#getValue(int)">getValue</A></B>(int&nbsp;index)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Gets the value associated with the item at a given index.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../com/google/gwt/user/client/ui/ListBox.html#getVisibleItemCount()">getVisibleItemCount</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Gets the number of items that are visible.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../com/google/gwt/user/client/ui/ListBox.html#insertItem(java.lang.String, int)">insertItem</A></B>(java.lang.String&nbsp;item,
           int&nbsp;index)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Inserts an item into the list box.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../com/google/gwt/user/client/ui/ListBox.html#insertItem(java.lang.String, java.lang.String, int)">insertItem</A></B>(java.lang.String&nbsp;item,
           java.lang.String&nbsp;value,
           int&nbsp;index)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Inserts an item into the list box, specifying an initial value for the
 item.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../com/google/gwt/user/client/ui/ListBox.html#isItemSelected(int)">isItemSelected</A></B>(int&nbsp;index)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Determines whether an individual list item is selected.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../com/google/gwt/user/client/ui/ListBox.html#isMultipleSelect()">isMultipleSelect</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Gets whether this list allows multiple selection.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../com/google/gwt/user/client/ui/ListBox.html#onBrowserEvent(com.google.gwt.user.client.Event)">onBrowserEvent</A></B>(<A HREF="../../../../../../com/google/gwt/user/client/Event.html" title="class in com.google.gwt.user.client">Event</A>&nbsp;event)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Fired whenever a browser event is received.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../com/google/gwt/user/client/ui/ListBox.html#onEnsureDebugId(java.lang.String)">onEnsureDebugId</A></B>(java.lang.String&nbsp;baseID)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b>Affected Elements:</b>
 
 -item# = the option at the specified index.
 </TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../com/google/gwt/user/client/ui/ListBox.html#removeChangeListener(com.google.gwt.user.client.ui.ChangeListener)">removeChangeListener</A></B>(<A HREF="../../../../../../com/google/gwt/user/client/ui/ChangeListener.html" title="interface in com.google.gwt.user.client.ui">ChangeListener</A>&nbsp;listener)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Removes a previously added listener interface.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../com/google/gwt/user/client/ui/ListBox.html#removeItem(int)">removeItem</A></B>(int&nbsp;index)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Removes the item at the specified index.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../com/google/gwt/user/client/ui/ListBox.html#setItemSelected(int, boolean)">setItemSelected</A></B>(int&nbsp;index,
                boolean&nbsp;selected)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets whether an individual list item is selected.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../com/google/gwt/user/client/ui/ListBox.html#setItemText(int, java.lang.String)">setItemText</A></B>(int&nbsp;index,
            java.lang.String&nbsp;text)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the text associated with the item at a given index.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../com/google/gwt/user/client/ui/ListBox.html#setMultipleSelect(boolean)">setMultipleSelect</A></B>(boolean&nbsp;multiple)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets whether this list allows multiple selections.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../com/google/gwt/user/client/ui/ListBox.html#setName(java.lang.String)">setName</A></B>(java.lang.String&nbsp;name)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the widget's name.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../com/google/gwt/user/client/ui/ListBox.html#setSelectedIndex(int)">setSelectedIndex</A></B>(int&nbsp;index)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the currently selected index.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../com/google/gwt/user/client/ui/ListBox.html#setValue(int, java.lang.String)">setValue</A></B>(int&nbsp;index,
         java.lang.String&nbsp;value)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the value associated with the item at a given index.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../com/google/gwt/user/client/ui/ListBox.html#setVisibleItemCount(int)">setVisibleItemCount</A></B>(int&nbsp;visibleItems)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the number of items that are visible.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;<A HREF="../../../../../../com/google/gwt/user/client/ui/ListBox.html" title="class in com.google.gwt.user.client.ui">ListBox</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../com/google/gwt/user/client/ui/ListBox.html#wrap(com.google.gwt.dom.client.Element)">wrap</A></B>(<A HREF="../../../../../../com/google/gwt/dom/client/Element.html" title="class in com.google.gwt.dom.client">Element</A>&nbsp;element)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Creates a ListBox widget that wraps an existing &lt;select&gt; element.</TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_com.google.gwt.user.client.ui.FocusWidget"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class com.google.gwt.user.client.ui.<A HREF="../../../../../../com/google/gwt/user/client/ui/FocusWidget.html" title="class in com.google.gwt.user.client.ui">FocusWidget</A></B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="../../../../../../com/google/gwt/user/client/ui/FocusWidget.html#addClickListener(com.google.gwt.user.client.ui.ClickListener)">addClickListener</A>, <A HREF="../../../../../../com/google/gwt/user/client/ui/FocusWidget.html#addFocusListener(com.google.gwt.user.client.ui.FocusListener)">addFocusListener</A>, <A HREF="../../../../../../com/google/gwt/user/client/ui/FocusWidget.html#addKeyboardListener(com.google.gwt.user.client.ui.KeyboardListener)">addKeyboardListener</A>, <A HREF="../../../../../../com/google/gwt/user/client/ui/FocusWidget.html#getFocusImpl()">getFocusImpl</A>, <A HREF="../../../../../../com/google/gwt/user/client/ui/FocusWidget.html#getTabIndex()">getTabIndex</A>, <A HREF="../../../../../../com/google/gwt/user/client/ui/FocusWidget.html#isEnabled()">isEnabled</A>, <A HREF="../../../../../../com/google/gwt/user/client/ui/FocusWidget.html#removeClickListener(com.google.gwt.user.client.ui.ClickListener)">removeClickListener</A>, <A HREF="../../../../../../com/google/gwt/user/client/ui/FocusWidget.html#removeFocusListener(com.google.gwt.user.client.ui.FocusListener)">removeFocusListener</A>, <A HREF="../../../../../../com/google/gwt/user/client/ui/FocusWidget.html#removeKeyboardListener(com.google.gwt.user.client.ui.KeyboardListener)">removeKeyboardListener</A>, <A HREF="../../../../../../com/google/gwt/user/client/ui/FocusWidget.html#setAccessKey(char)">setAccessKey</A>, <A HREF="../../../../../../com/google/gwt/user/client/ui/FocusWidget.html#setElement(com.google.gwt.user.client.Element)">setElement</A>, <A HREF="../../../../../../com/google/gwt/user/client/ui/FocusWidget.html#setEnabled(boolean)">setEnabled</A>, <A HREF="../../../../../../com/google/gwt/user/client/ui/FocusWidget.html#setFocus(boolean)">setFocus</A>, <A HREF="../../../../../../com/google/gwt/user/client/ui/FocusWidget.html#setTabIndex(int)">setTabIndex</A></CODE></TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_com.google.gwt.user.client.ui.Widget"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class com.google.gwt.user.client.ui.<A HREF="../../../../../../com/google/gwt/user/client/ui/Widget.html" title="class in com.google.gwt.user.client.ui">Widget</A></B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="../../../../../../com/google/gwt/user/client/ui/Widget.html#doAttachChildren()">doAttachChildren</A>, <A HREF="../../../../../../com/google/gwt/user/client/ui/Widget.html#doDetachChildren()">doDetachChildren</A>, <A HREF="../../../../../../com/google/gwt/user/client/ui/Widget.html#getParent()">getParent</A>, <A HREF="../../../../../../com/google/gwt/user/client/ui/Widget.html#isAttached()">isAttached</A>, <A HREF="../../../../../../com/google/gwt/user/client/ui/Widget.html#onAttach()">onAttach</A>, <A HREF="../../../../../../com/google/gwt/user/client/ui/Widget.html#onDetach()">onDetach</A>, <A HREF="../../../../../../com/google/gwt/user/client/ui/Widget.html#onLoad()">onLoad</A>, <A HREF="../../../../../../com/google/gwt/user/client/ui/Widget.html#onUnload()">onUnload</A>, <A HREF="../../../../../../com/google/gwt/user/client/ui/Widget.html#removeFromParent()">removeFromParent</A></CODE></TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_com.google.gwt.user.client.ui.UIObject"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class com.google.gwt.user.client.ui.<A HREF="../../../../../../com/google/gwt/user/client/ui/UIObject.html" title="class in com.google.gwt.user.client.ui">UIObject</A></B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="../../../../../../com/google/gwt/user/client/ui/UIObject.html#addStyleDependentName(java.lang.String)">addStyleDependentName</A>, <A HREF="../../../../../../com/google/gwt/user/client/ui/UIObject.html#addStyleName(java.lang.String)">addStyleName</A>, <A HREF="../../../../../../com/google/gwt/user/client/ui/UIObject.html#ensureDebugId(com.google.gwt.dom.client.Element, java.lang.String)">ensureDebugId</A>, <A HREF="../../../../../../com/google/gwt/user/client/ui/UIObject.html#ensureDebugId(com.google.gwt.dom.client.Element, java.lang.String, java.lang.String)">ensureDebugId</A>, <A HREF="../../../../../../com/google/gwt/user/client/ui/UIObject.html#ensureDebugId(java.lang.String)">ensureDebugId</A>, <A HREF="../../../../../../com/google/gwt/user/client/ui/UIObject.html#getAbsoluteLeft()">getAbsoluteLeft</A>, <A HREF="../../../../../../com/google/gwt/user/client/ui/UIObject.html#getAbsoluteTop()">getAbsoluteTop</A>, <A HREF="../../../../../../com/google/gwt/user/client/ui/UIObject.html#getElement()">getElement</A>, <A HREF="../../../../../../com/google/gwt/user/client/ui/UIObject.html#getOffsetHeight()">getOffsetHeight</A>, <A HREF="../../../../../../com/google/gwt/user/client/ui/UIObject.html#getOffsetWidth()">getOffsetWidth</A>, <A HREF="../../../../../../com/google/gwt/user/client/ui/UIObject.html#getStyleElement()">getStyleElement</A>, <A HREF="../../../../../../com/google/gwt/user/client/ui/UIObject.html#getStyleName()">getStyleName</A>, <A HREF="../../../../../../com/google/gwt/user/client/ui/UIObject.html#getStyleName(com.google.gwt.dom.client.Element)">getStyleName</A>, <A HREF="../../../../../../com/google/gwt/user/client/ui/UIObject.html#getStylePrimaryName()">getStylePrimaryName</A>, <A HREF="../../../../../../com/google/gwt/user/client/ui/UIObject.html#getStylePrimaryName(com.google.gwt.dom.client.Element)">getStylePrimaryName</A>, <A HREF="../../../../../../com/google/gwt/user/client/ui/UIObject.html#getTitle()">getTitle</A>, <A HREF="../../../../../../com/google/gwt/user/client/ui/UIObject.html#isVisible()">isVisible</A>, <A HREF="../../../../../../com/google/gwt/user/client/ui/UIObject.html#isVisible(com.google.gwt.dom.client.Element)">isVisible</A>, <A HREF="../../../../../../com/google/gwt/user/client/ui/UIObject.html#removeStyleDependentName(java.lang.String)">removeStyleDependentName</A>, <A HREF="../../../../../../com/google/gwt/user/client/ui/UIObject.html#removeStyleName(java.lang.String)">removeStyleName</A>, <A HREF="../../../../../../com/google/gwt/user/client/ui/UIObject.html#setElement(com.google.gwt.dom.client.Element)">setElement</A>, <A HREF="../../../../../../com/google/gwt/user/client/ui/UIObject.html#setHeight(java.lang.String)">setHeight</A>, <A HREF="../../../../../../com/google/gwt/user/client/ui/UIObject.html#setPixelSize(int, int)">setPixelSize</A>, <A HREF="../../../../../../com/google/gwt/user/client/ui/UIObject.html#setSize(java.lang.String, java.lang.String)">setSize</A>, <A HREF="../../../../../../com/google/gwt/user/client/ui/UIObject.html#setStyleName(com.google.gwt.dom.client.Element, java.lang.String)">setStyleName</A>, <A HREF="../../../../../../com/google/gwt/user/client/ui/UIObject.html#setStyleName(com.google.gwt.dom.client.Element, java.lang.String, boolean)">setStyleName</A>, <A HREF="../../../../../../com/google/gwt/user/client/ui/UIObject.html#setStyleName(java.lang.String)">setStyleName</A>, <A HREF="../../../../../../com/google/gwt/user/client/ui/UIObject.html#setStylePrimaryName(com.google.gwt.dom.client.Element, java.lang.String)">setStylePrimaryName</A>, <A HREF="../../../../../../com/google/gwt/user/client/ui/UIObject.html#setStylePrimaryName(java.lang.String)">setStylePrimaryName</A>, <A HREF="../../../../../../com/google/gwt/user/client/ui/UIObject.html#setTitle(java.lang.String)">setTitle</A>, <A HREF="../../../../../../com/google/gwt/user/client/ui/UIObject.html#setVisible(boolean)">setVisible</A>, <A HREF="../../../../../../com/google/gwt/user/client/ui/UIObject.html#setVisible(com.google.gwt.dom.client.Element, boolean)">setVisible</A>, <A HREF="../../../../../../com/google/gwt/user/client/ui/UIObject.html#setWidth(java.lang.String)">setWidth</A>, <A HREF="../../../../../../com/google/gwt/user/client/ui/UIObject.html#sinkEvents(int)">sinkEvents</A>, <A HREF="../../../../../../com/google/gwt/user/client/ui/UIObject.html#toString()">toString</A>, <A HREF="../../../../../../com/google/gwt/user/client/ui/UIObject.html#unsinkEvents(int)">unsinkEvents</A></CODE></TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait</CODE></TD>
</TR>
</TABLE>
&nbsp;
<P>

<!-- ========= CONSTRUCTOR DETAIL ======== -->

<A NAME="constructor_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Constructor Detail</B></FONT></TH>
</TR>
</TABLE>

<A NAME="ListBox()"><!-- --></A><H3>
ListBox</H3>
<PRE>
public <B>ListBox</B>()</PRE>
<DL>
<DD>Creates an empty list box in single selection mode.
<P>
</DL>
<HR>

<A NAME="ListBox(boolean)"><!-- --></A><H3>
ListBox</H3>
<PRE>
public <B>ListBox</B>(boolean&nbsp;isMultipleSelect)</PRE>
<DL>
<DD>Creates an empty list box. The preferred way to enable multiple selections
 is to use this constructor rather than <A HREF="../../../../../../com/google/gwt/user/client/ui/ListBox.html#setMultipleSelect(boolean)"><CODE>setMultipleSelect(boolean)</CODE></A>.
<P>
<DL>
<DT><B>Parameters:</B><DD><CODE>isMultipleSelect</CODE> - specifies if multiple selection is enabled</DL>
</DL>
<HR>

<A NAME="ListBox(com.google.gwt.dom.client.Element)"><!-- --></A><H3>
ListBox</H3>
<PRE>
protected <B>ListBox</B>(<A HREF="../../../../../../com/google/gwt/dom/client/Element.html" title="class in com.google.gwt.dom.client">Element</A>&nbsp;element)</PRE>
<DL>
<DD>This constructor may be used by subclasses to explicitly use an existing
 element. This element must be a &lt;select&gt; element.
<P>
<DL>
<DT><B>Parameters:</B><DD><CODE>element</CODE> - the element to be used</DL>
</DL>

<!-- ============ METHOD DETAIL ========== -->

<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Method Detail</B></FONT></TH>
</TR>
</TABLE>

<A NAME="wrap(com.google.gwt.dom.client.Element)"><!-- --></A><H3>
wrap</H3>
<PRE>
public static <A HREF="../../../../../../com/google/gwt/user/client/ui/ListBox.html" title="class in com.google.gwt.user.client.ui">ListBox</A> <B>wrap</B>(<A HREF="../../../../../../com/google/gwt/dom/client/Element.html" title="class in com.google.gwt.dom.client">Element</A>&nbsp;element)</PRE>
<DL>
<DD>Creates a ListBox widget that wraps an existing &lt;select&gt; element.
 
 This element must already be attached to the document. If the element is
 removed from the document, you must call
 <A HREF="../../../../../../com/google/gwt/user/client/ui/RootPanel.html#detachNow(com.google.gwt.user.client.ui.Widget)"><CODE>RootPanel.detachNow(Widget)</CODE></A>.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>element</CODE> - the element to be wrapped</DL>
</DD>
</DL>
<HR>

<A NAME="addChangeListener(com.google.gwt.user.client.ui.ChangeListener)"><!-- --></A><H3>
addChangeListener</H3>
<PRE>
public void <B>addChangeListener</B>(<A HREF="../../../../../../com/google/gwt/user/client/ui/ChangeListener.html" title="interface in com.google.gwt.user.client.ui">ChangeListener</A>&nbsp;listener)</PRE>
<DL>
<DD><B>Description copied from interface: <CODE><A HREF="../../../../../../com/google/gwt/user/client/ui/SourcesChangeEvents.html#addChangeListener(com.google.gwt.user.client.ui.ChangeListener)">SourcesChangeEvents</A></CODE></B></DD>
<DD>Adds a listener interface to receive change events.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../../com/google/gwt/user/client/ui/SourcesChangeEvents.html#addChangeListener(com.google.gwt.user.client.ui.ChangeListener)">addChangeListener</A></CODE> in interface <CODE><A HREF="../../../../../../com/google/gwt/user/client/ui/SourcesChangeEvents.html" title="interface in com.google.gwt.user.client.ui">SourcesChangeEvents</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>listener</CODE> - the listener interface to add</DL>
</DD>
</DL>
<HR>

<A NAME="addItem(java.lang.String)"><!-- --></A><H3>
addItem</H3>
<PRE>
public void <B>addItem</B>(java.lang.String&nbsp;item)</PRE>
<DL>
<DD>Adds an item to the list box. This method has the same effect as
 
 <pre>
 addItem(item, item)
 </pre>
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>item</CODE> - the text of the item to be added</DL>
</DD>
</DL>
<HR>

<A NAME="addItem(java.lang.String, java.lang.String)"><!-- --></A><H3>
addItem</H3>
<PRE>
public void <B>addItem</B>(java.lang.String&nbsp;item,
                    java.lang.String&nbsp;value)</PRE>
<DL>
<DD>Adds an item to the list box, specifying an initial value for the item.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>item</CODE> - the text of the item to be added<DD><CODE>value</CODE> - the item's value, to be submitted if it is part of a
          <A HREF="../../../../../../com/google/gwt/user/client/ui/FormPanel.html" title="class in com.google.gwt.user.client.ui"><CODE>FormPanel</CODE></A>; cannot be <code>null</code></DL>
</DD>
</DL>
<HR>

<A NAME="clear()"><!-- --></A><H3>
clear</H3>
<PRE>
public void <B>clear</B>()</PRE>
<DL>
<DD>Removes all items from the list box.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>

<A NAME="getItemCount()"><!-- --></A><H3>
getItemCount</H3>
<PRE>
public int <B>getItemCount</B>()</PRE>
<DL>
<DD>Gets the number of items present in the list box.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>

<DT><B>Returns:</B><DD>the number of items</DL>
</DD>
</DL>
<HR>

<A NAME="getItemText(int)"><!-- --></A><H3>
getItemText</H3>
<PRE>
public java.lang.String <B>getItemText</B>(int&nbsp;index)</PRE>
<DL>
<DD>Gets the text associated with the item at the specified index.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>index</CODE> - the index of the item whose text is to be retrieved
<DT><B>Returns:</B><DD>the text associated with the item
<DT><B>Throws:</B>
<DD><CODE>java.lang.IndexOutOfBoundsException</CODE> - if the index is out of range</DL>
</DD>
</DL>
<HR>

<A NAME="getName()"><!-- --></A><H3>
getName</H3>
<PRE>
public java.lang.String <B>getName</B>()</PRE>
<DL>
<DD><B>Description copied from interface: <CODE><A HREF="../../../../../../com/google/gwt/user/client/ui/HasName.html#getName()">HasName</A></CODE></B></DD>
<DD>Gets the widget's name.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../../com/google/gwt/user/client/ui/HasName.html#getName()">getName</A></CODE> in interface <CODE><A HREF="../../../../../../com/google/gwt/user/client/ui/HasName.html" title="interface in com.google.gwt.user.client.ui">HasName</A></CODE></DL>
</DD>
<DD><DL>

<DT><B>Returns:</B><DD>the widget's name</DL>
</DD>
</DL>
<HR>

<A NAME="getSelectedIndex()"><!-- --></A><H3>
getSelectedIndex</H3>
<PRE>
public int <B>getSelectedIndex</B>()</PRE>
<DL>
<DD>Gets the currently-selected item. If multiple items are selected, this
 method will return the first selected item (<A HREF="../../../../../../com/google/gwt/user/client/ui/ListBox.html#isItemSelected(int)"><CODE>isItemSelected(int)</CODE></A>
 can be used to query individual items).
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>

<DT><B>Returns:</B><DD>the selected index, or <code>-1</code> if none is selected</DL>
</DD>
</DL>
<HR>

<A NAME="getValue(int)"><!-- --></A><H3>
getValue</H3>
<PRE>
public java.lang.String <B>getValue</B>(int&nbsp;index)</PRE>
<DL>
<DD>Gets the value associated with the item at a given index.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>index</CODE> - the index of the item to be retrieved
<DT><B>Returns:</B><DD>the item's associated value
<DT><B>Throws:</B>
<DD><CODE>java.lang.IndexOutOfBoundsException</CODE> - if the index is out of range</DL>
</DD>
</DL>
<HR>

<A NAME="getVisibleItemCount()"><!-- --></A><H3>
getVisibleItemCount</H3>
<PRE>
public int <B>getVisibleItemCount</B>()</PRE>
<DL>
<DD>Gets the number of items that are visible. If only one item is visible,
 then the box will be displayed as a drop-down list.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>

<DT><B>Returns:</B><DD>the visible item count</DL>
</DD>
</DL>
<HR>

<A NAME="insertItem(java.lang.String, int)"><!-- --></A><H3>
insertItem</H3>
<PRE>
public void <B>insertItem</B>(java.lang.String&nbsp;item,
                       int&nbsp;index)</PRE>
<DL>
<DD>Inserts an item into the list box. Has the same effect as
 
 <pre>
 insertItem(item, item, index)
 </pre>
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>item</CODE> - the text of the item to be inserted<DD><CODE>index</CODE> - the index at which to insert it</DL>
</DD>
</DL>
<HR>

<A NAME="insertItem(java.lang.String, java.lang.String, int)"><!-- --></A><H3>
insertItem</H3>
<PRE>
public void <B>insertItem</B>(java.lang.String&nbsp;item,
                       java.lang.String&nbsp;value,
                       int&nbsp;index)</PRE>
<DL>
<DD>Inserts an item into the list box, specifying an initial value for the
 item. If the index is less than zero, or greater than or equal to
 the length of the list, then the item will be appended to the end of
 the list.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>item</CODE> - the text of the item to be inserted<DD><CODE>value</CODE> - the item's value, to be submitted if it is part of a
          <A HREF="../../../../../../com/google/gwt/user/client/ui/FormPanel.html" title="class in com.google.gwt.user.client.ui"><CODE>FormPanel</CODE></A>.<DD><CODE>index</CODE> - the index at which to insert it</DL>
</DD>
</DL>
<HR>

<A NAME="isItemSelected(int)"><!-- --></A><H3>
isItemSelected</H3>
<PRE>
public boolean <B>isItemSelected</B>(int&nbsp;index)</PRE>
<DL>
<DD>Determines whether an individual list item is selected.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>index</CODE> - the index of the item to be tested
<DT><B>Returns:</B><DD><code>true</code> if the item is selected
<DT><B>Throws:</B>
<DD><CODE>java.lang.IndexOutOfBoundsException</CODE> - if the index is out of range</DL>
</DD>
</DL>
<HR>

<A NAME="isMultipleSelect()"><!-- --></A><H3>
isMultipleSelect</H3>
<PRE>
public boolean <B>isMultipleSelect</B>()</PRE>
<DL>
<DD>Gets whether this list allows multiple selection.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>

<DT><B>Returns:</B><DD><code>true</code> if multiple selection is allowed</DL>
</DD>
</DL>
<HR>

<A NAME="onBrowserEvent(com.google.gwt.user.client.Event)"><!-- --></A><H3>
onBrowserEvent</H3>
<PRE>
public void <B>onBrowserEvent</B>(<A HREF="../../../../../../com/google/gwt/user/client/Event.html" title="class in com.google.gwt.user.client">Event</A>&nbsp;event)</PRE>
<DL>
<DD><B>Description copied from interface: <CODE><A HREF="../../../../../../com/google/gwt/user/client/EventListener.html#onBrowserEvent(com.google.gwt.user.client.Event)">EventListener</A></CODE></B></DD>
<DD>Fired whenever a browser event is received.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../../com/google/gwt/user/client/EventListener.html#onBrowserEvent(com.google.gwt.user.client.Event)">onBrowserEvent</A></CODE> in interface <CODE><A HREF="../../../../../../com/google/gwt/user/client/EventListener.html" title="interface in com.google.gwt.user.client">EventListener</A></CODE><DT><B>Overrides:</B><DD><CODE><A HREF="../../../../../../com/google/gwt/user/client/ui/FocusWidget.html#onBrowserEvent(com.google.gwt.user.client.Event)">onBrowserEvent</A></CODE> in class <CODE><A HREF="../../../../../../com/google/gwt/user/client/ui/FocusWidget.html" title="class in com.google.gwt.user.client.ui">FocusWidget</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>event</CODE> - the event received</DL>
</DD>
</DL>
<HR>

<A NAME="removeChangeListener(com.google.gwt.user.client.ui.ChangeListener)"><!-- --></A><H3>
removeChangeListener</H3>
<PRE>
public void <B>removeChangeListener</B>(<A HREF="../../../../../../com/google/gwt/user/client/ui/ChangeListener.html" title="interface in com.google.gwt.user.client.ui">ChangeListener</A>&nbsp;listener)</PRE>
<DL>
<DD><B>Description copied from interface: <CODE><A HREF="../../../../../../com/google/gwt/user/client/ui/SourcesChangeEvents.html#removeChangeListener(com.google.gwt.user.client.ui.ChangeListener)">SourcesChangeEvents</A></CODE></B></DD>
<DD>Removes a previously added listener interface.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../../com/google/gwt/user/client/ui/SourcesChangeEvents.html#removeChangeListener(com.google.gwt.user.client.ui.ChangeListener)">removeChangeListener</A></CODE> in interface <CODE><A HREF="../../../../../../com/google/gwt/user/client/ui/SourcesChangeEvents.html" title="interface in com.google.gwt.user.client.ui">SourcesChangeEvents</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>listener</CODE> - the listener interface to remove</DL>
</DD>
</DL>
<HR>

<A NAME="removeItem(int)"><!-- --></A><H3>
removeItem</H3>
<PRE>
public void <B>removeItem</B>(int&nbsp;index)</PRE>
<DL>
<DD>Removes the item at the specified index.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>index</CODE> - the index of the item to be removed
<DT><B>Throws:</B>
<DD><CODE>java.lang.IndexOutOfBoundsException</CODE> - if the index is out of range</DL>
</DD>
</DL>
<HR>

<A NAME="setItemSelected(int, boolean)"><!-- --></A><H3>
setItemSelected</H3>
<PRE>
public void <B>setItemSelected</B>(int&nbsp;index,
                            boolean&nbsp;selected)</PRE>
<DL>
<DD>Sets whether an individual list item is selected.
 
 <p>
 Note that setting the selection programmatically does <em>not</em> cause
 the <A HREF="../../../../../../com/google/gwt/user/client/ui/ChangeListener.html#onChange(com.google.gwt.user.client.ui.Widget)"><CODE>ChangeListener.onChange(Widget)</CODE></A> event to be fired.
 </p>
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>index</CODE> - the index of the item to be selected or unselected<DD><CODE>selected</CODE> - <code>true</code> to select the item
<DT><B>Throws:</B>
<DD><CODE>java.lang.IndexOutOfBoundsException</CODE> - if the index is out of range</DL>
</DD>
</DL>
<HR>

<A NAME="setItemText(int, java.lang.String)"><!-- --></A><H3>
setItemText</H3>
<PRE>
public void <B>setItemText</B>(int&nbsp;index,
                        java.lang.String&nbsp;text)</PRE>
<DL>
<DD>Sets the text associated with the item at a given index.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>index</CODE> - the index of the item to be set<DD><CODE>text</CODE> - the item's new text
<DT><B>Throws:</B>
<DD><CODE>java.lang.IndexOutOfBoundsException</CODE> - if the index is out of range</DL>
</DD>
</DL>
<HR>

<A NAME="setMultipleSelect(boolean)"><!-- --></A><H3>
setMultipleSelect</H3>
<PRE>
public void <B>setMultipleSelect</B>(boolean&nbsp;multiple)</PRE>
<DL>
<DD>Sets whether this list allows multiple selections. <em>NOTE: The preferred
 way of enabling multiple selections in a list box is by using the
 <A HREF="../../../../../../com/google/gwt/user/client/ui/ListBox.html#ListBox(boolean)"><CODE>ListBox(boolean)</CODE></A> constructor. Using this method can spuriously
 fail on Internet Explorer 6.0.</em>
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>multiple</CODE> - <code>true</code> to allow multiple selections</DL>
</DD>
</DL>
<HR>

<A NAME="setName(java.lang.String)"><!-- --></A><H3>
setName</H3>
<PRE>
public void <B>setName</B>(java.lang.String&nbsp;name)</PRE>
<DL>
<DD><B>Description copied from interface: <CODE><A HREF="../../../../../../com/google/gwt/user/client/ui/HasName.html#setName(java.lang.String)">HasName</A></CODE></B></DD>
<DD>Sets the widget's name.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../../com/google/gwt/user/client/ui/HasName.html#setName(java.lang.String)">setName</A></CODE> in interface <CODE><A HREF="../../../../../../com/google/gwt/user/client/ui/HasName.html" title="interface in com.google.gwt.user.client.ui">HasName</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>name</CODE> - the widget's new name</DL>
</DD>
</DL>
<HR>

<A NAME="setSelectedIndex(int)"><!-- --></A><H3>
setSelectedIndex</H3>
<PRE>
public void <B>setSelectedIndex</B>(int&nbsp;index)</PRE>
<DL>
<DD>Sets the currently selected index.
 
 After calling this method, only the specified item in the list will
 remain selected.  For a ListBox with multiple selection enabled, see
 <A HREF="../../../../../../com/google/gwt/user/client/ui/ListBox.html#setItemSelected(int, boolean)"><CODE>setItemSelected(int, boolean)</CODE></A> to select multiple items at a time.
 
 <p>
 Note that setting the selected index programmatically does <em>not</em>
 cause the <A HREF="../../../../../../com/google/gwt/user/client/ui/ChangeListener.html#onChange(com.google.gwt.user.client.ui.Widget)"><CODE>ChangeListener.onChange(Widget)</CODE></A> event to be fired.
 </p>
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>index</CODE> - the index of the item to be selected</DL>
</DD>
</DL>
<HR>

<A NAME="setValue(int, java.lang.String)"><!-- --></A><H3>
setValue</H3>
<PRE>
public void <B>setValue</B>(int&nbsp;index,
                     java.lang.String&nbsp;value)</PRE>
<DL>
<DD>Sets the value associated with the item at a given index. This value can be
 used for any purpose, but is also what is passed to the server when the
 list box is submitted as part of a <A HREF="../../../../../../com/google/gwt/user/client/ui/FormPanel.html" title="class in com.google.gwt.user.client.ui"><CODE>FormPanel</CODE></A>.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>index</CODE> - the index of the item to be set<DD><CODE>value</CODE> - the item's new value; cannot be <code>null</code>
<DT><B>Throws:</B>
<DD><CODE>java.lang.IndexOutOfBoundsException</CODE> - if the index is out of range</DL>
</DD>
</DL>
<HR>

<A NAME="setVisibleItemCount(int)"><!-- --></A><H3>
setVisibleItemCount</H3>
<PRE>
public void <B>setVisibleItemCount</B>(int&nbsp;visibleItems)</PRE>
<DL>
<DD>Sets the number of items that are visible. If only one item is visible,
 then the box will be displayed as a drop-down list.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>visibleItems</CODE> - the visible item count</DL>
</DD>
</DL>
<HR>

<A NAME="onEnsureDebugId(java.lang.String)"><!-- --></A><H3>
onEnsureDebugId</H3>
<PRE>
protected void <B>onEnsureDebugId</B>(java.lang.String&nbsp;baseID)</PRE>
<DL>
<DD><b>Affected Elements:</b>
 <ul>
 <li>-item# = the option at the specified index.</li>
 </ul>
<P>
<DD><DL>
<DT><B>Overrides:</B><DD><CODE><A HREF="../../../../../../com/google/gwt/user/client/ui/UIObject.html#onEnsureDebugId(java.lang.String)">onEnsureDebugId</A></CODE> in class <CODE><A HREF="../../../../../../com/google/gwt/user/client/ui/UIObject.html" title="class in com.google.gwt.user.client.ui">UIObject</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>baseID</CODE> - the base ID used by the main element<DT><B>See Also:</B><DD><A HREF="../../../../../../com/google/gwt/user/client/ui/UIObject.html#onEnsureDebugId(java.lang.String)"><CODE>UIObject.onEnsureDebugId(String)</CODE></A></DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>


<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../../../../com/google/gwt/user/client/ui/Label.html" title="class in com.google.gwt.user.client.ui"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../../../../com/google/gwt/user/client/ui/LoadListener.html" title="interface in com.google.gwt.user.client.ui"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../../../../../index.html?com/google/gwt/user/client/ui/ListBox.html" target="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="ListBox.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
&nbsp;<SCRIPT type="text/javascript">
  <!--
  if(window==top) {
    document.writeln('<A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
  }
  //-->
</SCRIPT>
<NOSCRIPT>
  <A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>


</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  SUMMARY:&nbsp;<A HREF="#nested_classes_inherited_from_class_com.google.gwt.user.client.ui.UIObject">NESTED</A>&nbsp;|&nbsp;<A HREF="#fields_inherited_from_class_com.google.gwt.user.client.ui.UIObject">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->

<HR>

</BODY>
</HTML>
